<template>
  <el-form ref="form" :rules="rules" :model="form">
    <el-form-item prop="companyName">
      <i></i>
      <el-input clearable v-model.trim="form.companyName" placeholder="请输入公司名称" auto-complete="true"></el-input>
    </el-form-item>
    <el-form-item prop="number">
      <el-input clearable v-model="form.number" placeholder="请输入员工数量" auto-complete="true"></el-input>
    </el-form-item>
    <el-form-item prop="code">
      <i></i>
      <el-input clearable v-model.trim="form.code" placeholder="请输入账号" auto-complete="true"></el-input>
      <!--<p class="tip">6-20位字母或字母与数字组合</p>-->
    </el-form-item>

    <el-form-item prop="password">
      <i></i>
      <el-input clearable type="password" v-model.trim="form.password" placeholder="请输入密码" auto-complete="true"></el-input>
      <!--<p class="tip">6-20位英文字母、数字或者符号（除空格），且字母、数字和标点符号至少包含两种</p>-->
    </el-form-item>

    <el-form-item prop="rePassword">
      <i></i>
      <el-input clearable type="password" v-model.trim="form.rePassword" placeholder="请输入确认密码" auto-complete="true"></el-input>
    </el-form-item>
    <el-form-item prop="contacts">
      <i></i>
      <el-input clearable v-model="form.contacts" placeholder="请输入联系人" auto-complete="true"></el-input>
    </el-form-item>
    <el-form-item  prop="phone">
      <i></i>
      <el-input clearable v-model="form.phone" placeholder="请输入联系人手机号码" auto-complete="true"></el-input>
    </el-form-item>
    <el-form-item  prop="email">
      <el-input clearable v-model.trim="form.email" placeholder="请输入邮箱" auto-complete="true"></el-input>
    </el-form-item>
    <!--<el-form-item  prop="imgCode">-->
      <!--<i></i>-->
      <!--<el-input v-model="form.imgCode" placeholder="请输入验证码" auto-complete="true"></el-input>-->
      <!--<img class="loginCodeImg" :src="getImgCodeResults" @click="editCaptcha">-->
    <!--</el-form-item>-->
    <el-button class="btn-login" type="primary" size="medium" @click="submitForm('form')">提交申请</el-button>
  </el-form>
</template>

<script>
  import rules from "../../../../static/js/validator/rules.js"
    export default {
        name: "testAddUser",
      data () {
        return {
          // 提交的参数
          form: {
            companyName: '',
            number: '',
            code: '',
            password: '',
            rePassword: '',
            contacts: '', // 联系人
            phone: '',
            email: '',
            imgCode: ''
          },
          getImgCodeResults: '',
          keyResults: '',
          // 校验规则
          rules: {
            companyName: [
              {required: true, message: '请输入公司名称', trigger: 'blur'},
              // 可以设置双重验证标准
              {max: 30, message: '公司名称不可超过30个字符11'}
            ],
            number: [
              {required: false, validator: rules.FormValidate.Form().validateNumber, trigger: 'change'},
              {max: 10, message: '员工数量不可超过10亿'}
            ],
            code: [{required: true, validator: rules.FormValidate.Form().validateCode, rigger: 'blur'}],
            password: [{required: true, validator: rules.FormValidate.Form().validatePsdReg, rigger: 'blur'}],

            contacts: [
              {required: true, validator: rules.FormValidate.Form().validateContacts, rigger: 'blue'},
              {max: 10, message: '联系人不可超过10个字符'}
            ],
            phone: [{required: true, validator: rules.FormValidate.Form().validatePhone, trigger: 'blur'}],
            email: [{required: false, validator: rules.FormValidate.Form().validateEmail, trigger: 'change'}],
            imgCode: [{required: true, message: '请输入验证码', rigger: 'blue'}]
          }
        }
      }

    }
</script>

<style scoped>

</style>
